3.1.70 \(\int \frac {(2-x-2 x^2+x^3) (d+e x+f x^2+g x^3)}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=51 \[ \log (x+2) (d-2 e+4 f-8 g)+x (e-4 f+12 g)+\frac {1}{2} (x+2)^2 (f-6 g)+\frac {1}{3} g (x+2)^3 \]

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {1586, 1850} \begin {gather*} \log (x+2) (d-2 e+4 f-8 g)+x (e-4 f+12 g)+\frac {1}{2} (x+2)^2 (f-6 g)+\frac {1}{3} g (x+2)^3 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3))/(4 - 5*x^2 + x^4),x]

[Out]

(e - 4*f + 12*g)*x + ((f - 6*g)*(2 + x)^2)/2 + (g*(2 + x)^3)/3 + (d - 2*e + 4*f - 8*g)*Log[2 + x]

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1850

Int[(Pq_)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^n)^p, x], x] /; FreeQ[
{a, b, n}, x] && PolyQ[Pq, x] && (IGtQ[p, 0] || EqQ[n, 1])

Rubi steps

\begin {align*} \int \frac {\left (2-x-2 x^2+x^3\right ) \left (d+e x+f x^2+g x^3\right )}{4-5 x^2+x^4} \, dx &=\int \frac {d+e x+f x^2+g x^3}{2+x} \, dx\\ &=\int \left (e-4 f+12 g+\frac {d-2 e+4 f-8 g}{2+x}+(f-6 g) (2+x)+g (2+x)^2\right ) \, dx\\ &=(e-4 f+12 g) x+\frac {1}{2} (f-6 g) (2+x)^2+\frac {1}{3} g (2+x)^3+(d-2 e+4 f-8 g) \log (2+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 45, normalized size = 0.88 \begin {gather*} \log (x+2) (d-2 e+4 f-8 g)+\frac {1}{6} (x+2) \left (6 e+3 f (x-6)+2 g \left (x^2-5 x+22\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3))/(4 - 5*x^2 + x^4),x]

[Out]

((2 + x)*(6*e + 3*f*(-6 + x) + 2*g*(22 - 5*x + x^2)))/6 + (d - 2*e + 4*f - 8*g)*Log[2 + x]

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (2-x-2 x^2+x^3\right ) \left (d+e x+f x^2+g x^3\right )}{4-5 x^2+x^4} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3))/(4 - 5*x^2 + x^4),x]

[Out]

IntegrateAlgebraic[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3))/(4 - 5*x^2 + x^4), x]

________________________________________________________________________________________

fricas [A]  time = 1.38, size = 43, normalized size = 0.84 \begin {gather*} \frac {1}{3} \, g x^{3} + \frac {1}{2} \, {\left (f - 2 \, g\right )} x^{2} + {\left (e - 2 \, f + 4 \, g\right )} x + {\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

1/3*g*x^3 + 1/2*(f - 2*g)*x^2 + (e - 2*f + 4*g)*x + (d - 2*e + 4*f - 8*g)*log(x + 2)

________________________________________________________________________________________

giac [A]  time = 0.25, size = 49, normalized size = 0.96 \begin {gather*} \frac {1}{3} \, g x^{3} + \frac {1}{2} \, f x^{2} - g x^{2} - 2 \, f x + 4 \, g x + x e + {\left (d + 4 \, f - 8 \, g - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

1/3*g*x^3 + 1/2*f*x^2 - g*x^2 - 2*f*x + 4*g*x + x*e + (d + 4*f - 8*g - 2*e)*log(abs(x + 2))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 58, normalized size = 1.14 \begin {gather*} \frac {g \,x^{3}}{3}+\frac {f \,x^{2}}{2}-g \,x^{2}+d \ln \left (x +2\right )+e x -2 e \ln \left (x +2\right )-2 f x +4 f \ln \left (x +2\right )+4 g x -8 g \ln \left (x +2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^3-2*x^2-x+2)*(g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

1/3*g*x^3+1/2*f*x^2-g*x^2+e*x-2*f*x+4*g*x+d*ln(x+2)-2*e*ln(x+2)+4*f*ln(x+2)-8*g*ln(x+2)

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 43, normalized size = 0.84 \begin {gather*} \frac {1}{3} \, g x^{3} + \frac {1}{2} \, {\left (f - 2 \, g\right )} x^{2} + {\left (e - 2 \, f + 4 \, g\right )} x + {\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

1/3*g*x^3 + 1/2*(f - 2*g)*x^2 + (e - 2*f + 4*g)*x + (d - 2*e + 4*f - 8*g)*log(x + 2)

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 44, normalized size = 0.86 \begin {gather*} x^2\,\left (\frac {f}{2}-g\right )+x\,\left (e-2\,f+4\,g\right )+\frac {g\,x^3}{3}+\ln \left (x+2\right )\,\left (d-2\,e+4\,f-8\,g\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-((d + e*x + f*x^2 + g*x^3)*(x + 2*x^2 - x^3 - 2))/(x^4 - 5*x^2 + 4),x)

[Out]

x^2*(f/2 - g) + x*(e - 2*f + 4*g) + (g*x^3)/3 + log(x + 2)*(d - 2*e + 4*f - 8*g)

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 41, normalized size = 0.80 \begin {gather*} \frac {g x^{3}}{3} + x^{2} \left (\frac {f}{2} - g\right ) + x \left (e - 2 f + 4 g\right ) + \left (d - 2 e + 4 f - 8 g\right ) \log {\left (x + 2 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**3-2*x**2-x+2)*(g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

g*x**3/3 + x**2*(f/2 - g) + x*(e - 2*f + 4*g) + (d - 2*e + 4*f - 8*g)*log(x + 2)

________________________________________________________________________________________